#include<stdio.h>
#include<string.h>
int main()
{
    char s[1000];
    gets(s);
    int letter,number,space,other;
    letter=number=space=other=0;
    int i,len=strlen(s);
    for(i=0;i<len;i++)
        if('a'<=s[i]&&s[i]<='z'||'A'<=s[i]&&s[i]<='Z')
        ++letter;
    else if('0'<=s[i]&&s[i]<='9')
        ++number;
    else if(s[i]==' ')
        ++space;
    else
        ++other;
    printf("%d %d %d %d\n",letter,number,space,other);


    return 0;
}
